#include<bits/stdc++.h>
using namespace std;

#define int long long
#define inf (int)(1e9)

const int mod=998244353;
const int N=1e5+9;

int n;
int a[N];
int f[N],res;
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin>>n;
    for(int i=1;i<=n;++i) cin>>a[i];
    sort(a+1,a+n+1);

    res=0;
    for(int i=1;i<=n;++i) f[i]=-inf;
    for(int i=n;i>=1;--i){
        if(!res) f[++res]=a[i];
        else{
            int k=(upper_bound(f+1,f+res+1,a[i])-f);
            if(k>res) f[++res]=a[i];
            else f[k]=a[i];
        }
    }
    cout<<res;
}
/*

5
1 2 3 1 2

10
136 136 136 2417 136 136 2417 136 136 136
*/
